package com.shangyueshang.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shangyueshang.common.SysConstants;
import com.shangyueshang.mapper.PlatformSpendMapper;
import com.shangyueshang.model.PlatformSpend;
import com.shangyueshang.service.PlatformSpendService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.YearMonth;

/**
 * @author: JokeyZheng
 * @email: zhengjingfeng@ruqimobility.com
 * @created: 2022/1/18 17:03
 * @version: v1.0.0
 */
@Slf4j
@Service
public class PlatformSpendServiceImpl
		extends ServiceImpl<PlatformSpendMapper, PlatformSpend>
		implements PlatformSpendService {
	
	@Override
	public PlatformSpend getByShopAndMonth(String shop, YearMonth month) {
		return super.getOne(
				new QueryWrapper<PlatformSpend>()
						.eq(SysConstants.shop, shop)
						.eq(SysConstants.trade_month, month)
		);
	}
}
